{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" >


    <script src="{% static 'jquery/jquery-3.1.1.min.js' %}"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" ></script>
	<style>
		h1{
			margin_left:20px;
		}
	</style>
</head>

<body>
<p></p>

	<div class="content-box">


		<div class="container">
            <form class="form-signin" role="form" method='POST' enctype="multipart/form-data">
{#			<form class="form-horizontal" id="formId",method="POST" enctype="multipart/form-data">#}
                {%csrf_token%}

                <h2 class="form-signin-heading">license制作</h2>

				<div class="form-group">
					<label for=" " class="control-label col-md-9 col-sm-9">文件</label>
					<div class="col-md-8 col-sm-8">
						<input type="file" class="form-control files_input" name="filename">
						<p class="help-block">请选择上传文件</p>
                    </div>
                </div>
                <br>
                <div class="form-group">

                    <label for=" " class="control-label col-md-9 col-sm-9">有效期</label>
                    <div class="col-md-8 col-sm-8">
                        <input type="text" class="form-control days_input" name="days">
                        <p class="help-block">请输入许可证时间</p>
                    </div>

                </div>
                <br>
                <div class="form-group">
                    <label class="control-label col-md-9 col-sm-9">macs输入</label>
                    <div class="col-md-8 col-sm-8">
                        <textarea class="form-control macs_input" rows="9" name="macs"></textarea>
                    </div>
                </div>
                <br>

				<div class="form-group">
					<div class="col-md-2 col-sm-1"></div>
					<div class="col-md-9 col-sm-9">
						<button class="btn btn-primary" type="submit" >上传</button>
					</div>
				</div>
			</form>
            <div class="form-group">
					<div class="col-md-2 col-sm-1"></div>
					<div class="col-md-9 col-sm-9">
						<h3>license:</h3><p>{{message}}</p>
					</div>
				</div>

		</div>
	</div>




</body>
{#<script>#}
{##}
{##}
{#	$(document).ready(function(){#}
{#        $(".btn-primary").click(function(){#}
{#            var days = $('.days_input').val();#}
{#            var myFile = $('.files_input').val();#}
{#            var macs = $('.macs_input').val();#}
{#               $.ajax({#}
{#                   'url':window.location.href,#}
{##}
{#					'data':{#}
{#					    'days':days,#}
{#					    'filename':filename,#}
{#					    'macs':macs#}
{#					},#}
{#					'success': function(response) {#}
{#                        if (response.code == 'True') {#}
{#                            alert('上传成功');#}
{#                        }#}
{#                    },#}
{#					'error': function(error) {#}
{#                       alert('上传失败');#}
{#                       console.log(error);#}
{#				},#}
{##}
{##}
{#				});#}
{#			});#}
{#		});#}
{#//	function getScenedId(scece_name,td) {#}
{#//	    var post_data = {#}
{#//	      "name" : scene_name#}
{#//#}
{#//		};#}
{#//	    $.ajax({#}
{#//			url: {% url 'license_register' %},#}
{#//		    type:"POST",#}
{#//		    data:post_data,#}
{#//			success:function (data) {#}
{#//			    data = JSON.parse(data);#}
{#//			    if (data["status"] == 1){#}
{#//			        setSceneTd(data["result"], scece_name, td);#}
{#//				}else{#}
{#//			        alert(data["result"]);#}
{#//				}#}
{#//		    }#}
{#//		});#}
{#//	}#}
{#</script>#}
</html>



